{extend name="public:layout" /}
{block name="title"}店铺管理{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> 店铺列表</li>
            </ol>
        </div>
        <div class="ibox-content">
            <div class="toolbar">
                <div class="pull-left">
                    <a class="btn btn-primary" href="{:url('add')}">
                        <i class="fa fa-plus"></i>&nbsp;添加店铺
                    </a>
                </div>
                <div class="pull-right">
                    <form class="form-inline" method="post">
                        <div class="form-group">
                            <select class="form-control" name="searchKey">
                                <option value="site_no" {eq name="query.searchKey" value="site_no"}selected{/eq}>营业执照</option>
                                <option value="site_name" {eq name="query.searchKey" value="site_name"}selected{/eq}>店铺名称</option>
                                <option value="company_name" {eq name="query.searchKey" value="company_name"}selected{/eq}>公司名称</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <div class="input-group">
                                <input class="form-control" name="searchText" value="{$query.searchText}" type="text" placeholder="检索关键词">
                            </div>
                        </div>
                        <button type="submit" class="btn btn-info">
                            <i class="fa fa-search"></i> 搜索
                        </button>
                    </form>
                </div>
                <div class="clearfix"></div>
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th width="50">#</th>
                    <th>店铺名称</th>
                    <th>营业执照</th>
                    <th>店铺电话</th>
                    <th>推荐</th>
                    <th>店铺状态</th>
                    <th>排序</th>
                    <th width="120">操作</th>
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo"}
                <tr>
                    <td>{$vo.site_id}</td>
                    <td>
                        <a href="javascript:;"
                           data-html="true"
                           data-toggle="tooltip"
                           data-placement="right"
                           title="<p align='left'>
                                公司名称:{$vo.company_name}<br/>
                                店铺名称:{$vo.site_name}<br/>
                                店铺等级:{:str_repeat('★', $vo['grade_id'])}<br/>
                                省市区:{$vo.area_name}<br/>
                                店铺地址:{$vo.address}<br/>
                                </p>">
                            {$vo.site_name}</a>
                    </td>
                    <td>{$vo.site_no}</td>
                    <td>{$vo.site_tel}</td>
                    <td>{$vo['site_recommend']==1?'是':'否'}</td>
                    <td>
                        {eq name="vo.site_status" value="0"}关闭{/eq}
                        {eq name="vo.site_status" value="1"}开启{/eq}
                        {eq name="vo.site_status" value="2"}审核中{/eq}
                    </td>
                    <td>{$vo.site_sort}</td>
                    <td>
                        <a href="{:url('edit',['site_id'=>$vo['site_id']])}">编辑</a>
                        <a href="javascript:;" onclick="doAction(this);"
                           data-msg="确认操作吗？" data-url="{:url('setStatus')}" data-params="site_id={$vo.site_id}">
                            {eq name="vo.site_status" value="0"}开启{/eq}
                            {eq name="vo.site_status" value="1"}关闭{/eq}
                            {eq name="vo.site_status" value="2"}审核{/eq}
                        </a>
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
            <div class="page-bar">{$list->render()}</div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    $(function () {
        $('[data-toggle="tooltip"]').tooltip()
    })
</script>
{/block}